﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ThouShaltNotBrickLevelEditor.Code.Managers
{
    public sealed class CommandsManager
    {
        #region Constants
        #endregion

        #region Properties
        private LevelManager mLevelManager;
        #endregion

        #region Events
        #region CloseMainWindowsRequested
        public event EventHandler CloseMainWindowsRequested;
        private void RaiseCloseMainWindowsRequestedEvent()
        {
            var handler = CloseMainWindowsRequested;
            if (handler != null)
            {
                handler(this, EventArgs.Empty);
            }
        }
        #endregion
        #endregion

        #region Constructors
        public CommandsManager(LevelManager pLevelManager)
        {
            mLevelManager = pLevelManager;
        }
        #endregion

        #region Overriden Methods
        #endregion

        #region Methods
        public void LoadData(string pDataFolderPath)
        {
            mLevelManager.LoadData(pDataFolderPath);
        }

        public void LoadLevel(string pLevelFilePath)
        {
            mLevelManager.LoadLevel(pLevelFilePath);
        }

        public bool CanLoadLevel()
        {
            return mLevelManager.CanLoadLevel();
        }

        public void SaveLevel()
        {
            mLevelManager.SaveLevel();
        }

        public bool CanSaveLevel()
        {
            return mLevelManager.CanSaveLevel();
        }

        public void SaveLevelAs(string pLevelFilePath)
        {
            mLevelManager.SaveLevelAs(pLevelFilePath);
        }

        public bool CanSaveLevelAs()
        {
            return mLevelManager.CanSaveLevelAs();
        }

        public void CloseMainWindow()
        {
            RaiseCloseMainWindowsRequestedEvent();
        }
        #endregion

        #region Event Handlers
        #endregion

        #region Inner Classes
        #endregion
    }
}